<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>五子棋游戏房间</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/game_room.css">
    <style>
        /* 全局样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1f4037, #99f2c8);
            color: #333;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .nav {
            text-align: center;
            font-size: 2rem;
            margin-bottom: 20px;
            color: #fff;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }

        .container {
            display: flex;
            justify-content: space-around;
            background: rgba(255, 255, 255, 0.9);
            box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            padding: 20px;
            width: 900px;
        }

        #chess_area {
            position: relative;
        }

        #chess {
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
            border-radius: 10px;
        }

        #screen {
            position: absolute;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(255, 255, 255, 0.8);
            padding: 10px;
            border-radius: 10px;
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
            font-size: 1.2rem;
            color: #333;
        }

        #chat_area {
            width: 350px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        #chat_show {
            height: 300px;
            background-color: #f1f1f1;
            padding: 10px;
            overflow-y: scroll;
            border-radius: 10px;
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
        }

        #self_msg {
            text-align: right;
            color: #4CAF50;
        }

        #peer_msg {
            text-align: left;
            color: #2196F3;
        }

        #msg_show {
            margin-top: 10px;
            display: flex;
        }

        #chat_input {
            flex: 1;
            padding: 10px;
            font-size: 1rem;
            border-radius: 8px;
            border: 1px solid #ccc;
            box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);
            outline: none;
        }

        #chat_button {
            background-color: #2196F3;
            color: white;
            border: none;
            padding: 10px 20px;
            font-size: 1rem;
            margin-left: 10px;
            border-radius: 8px;
            cursor: pointer;
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
            transition: background-color 0.3s;
        }

        #chat_button:hover {
            background-color: #1E88E5;
        }

    </style>
</head>
<body>
    <div class="nav">网络五子棋对战游戏</div>
    <div class="container">
        <div id="chess_area">
            <!-- 棋盘区域, 基于 canvas 实现 -->
            <canvas id="chess" width="450px" height="450px"></canvas>
            <!-- 显示区域 -->
            <div id="screen"> 等待玩家连接中... </div>
        </div>
        <div id="chat_area">
            <div id="chat_show">
                <p id="self_msg">你好！</p>
                <p id="peer_msg">你好！</p>
                <p id="peer_msg">leihoua~</p>
            </div>
            <div id="msg_show">
                <input type="text" id="chat_input" placeholder="输入消息...">
                <button id="chat_button">发送</button>
            </div>
        </div>
    </div>
    <script>
        // 这里是脚本，保持不变
    </script>
</body>
</html>